﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_GhiGiamTaiSanList : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CKTuNgay")]
        private CheckBox _CKTuNgay;
        [AccessedThroughProperty("CmdExit")]
        private Button _CmdExit;
        [AccessedThroughProperty("CmdLoad")]
        private Button _CmdLoad;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private FA_GhiTangGiamTaiSan objTTS;

        public Frm_GhiGiamTaiSanList()
        {
            base.Load += new EventHandler(this.Frm_GhiGiamTaiSanList_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objTTS = new FA_GhiTangGiamTaiSan();
            this.InitializeComponent();
        }

        private void CKTuNgay_CheckedChanged(object sender, EventArgs e)
        {
            this.TxtTuNgay.Enabled = this.CKTuNgay.Checked;
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdLoad_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_GhiGiamTaiSanList_Load(object sender, EventArgs e)
        {
            this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
            this.LoadData();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_GhiGiamTaiSanList));
            this.Panel1 = new Panel();
            this.CKTuNgay = new CheckBox();
            this.CmdLoad = new Button();
            this.CmdExit = new Button();
            this.Label1 = new Label();
            this.TxtDenNgay = new DateTimePicker();
            this.TxtTuNgay = new DateTimePicker();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel1.SuspendLayout();
            this.VSlist.BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = (Image) manager.GetObject("Panel1.BackgroundImage");
            this.Panel1.Controls.Add(this.CKTuNgay);
            this.Panel1.Controls.Add(this.CmdLoad);
            this.Panel1.Controls.Add(this.CmdExit);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Dock = DockStyle.Top;
            Point point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x37e, 0x2c);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x1d;
            this.CKTuNgay.AutoSize = true;
            this.CKTuNgay.BackColor = Color.Transparent;
            point = new Point(6, 2);
            this.CKTuNgay.Location = point;
            this.CKTuNgay.Name = "CKTuNgay";
            size = new Size(0x41, 0x11);
            this.CKTuNgay.Size = size;
            this.CKTuNgay.TabIndex = 0x42;
            this.CKTuNgay.Text = "Từ ng\x00e0y";
            this.CKTuNgay.UseVisualStyleBackColor = false;
            this.CmdLoad.Image = ACCOUNTING.My.Resources.Resources.report;
            this.CmdLoad.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x2c9, 12);
            this.CmdLoad.Location = point;
            this.CmdLoad.Name = "CmdLoad";
            size = new Size(0x52, 0x1a);
            this.CmdLoad.Size = size;
            this.CmdLoad.TabIndex = 0x41;
            this.CmdLoad.Text = "Load";
            this.CmdLoad.UseVisualStyleBackColor = true;
            this.CmdExit.Image = ACCOUNTING.My.Resources.Resources.Closed;
            this.CmdExit.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x321, 12);
            this.CmdExit.Location = point;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x52, 0x1a);
            this.CmdExit.Size = size;
            this.CmdExit.TabIndex = 0x40;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdExit.UseVisualStyleBackColor = true;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0x55, 4);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x35, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x3f;
            this.Label1.Text = "Đến n&g\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Custom;
            point = new Point(90, 0x13);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x52, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x3e;
            this.TxtTuNgay.Enabled = false;
            this.TxtTuNgay.Format = DateTimePickerFormat.Custom;
            point = new Point(6, 0x13);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x51, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 60;
            this.VSlist.AllowEditing = false;
            this.VSlist.AutoResize = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0x2c);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x37e, 0x213);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 30;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x23f);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_GhiGiamTaiSanList";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "DANH SACH CHUNG TU GIAM TAI SAN";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSlist.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            string str;
            if (this.CKTuNgay.Checked)
            {
                str = " Loai = 0 And (T.NgayChungTu Between '" + LVYModule.Date2Char(this.TxtTuNgay.Text) + "' And '" + LVYModule.Date2Char(this.TxtDenNgay.Text) + "')";
            }
            else
            {
                str = " Loai = 0 And T.NgayChungTu <= '" + LVYModule.Date2Char(this.TxtDenNgay.Text) + "'";
            }
            DataTable list = this.objTTS.GetList(str);
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Rows.Count = 1;
            int num2 = list.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                vSlist.AddItem("");
                vSlist[i + 1, 0] = RuntimeHelpers.GetObjectValue(list.Rows[i]["Khoa"]);
                vSlist[i + 1, 1] = RuntimeHelpers.GetObjectValue(list.Rows[i]["SoChungTu"]);
                vSlist[i + 1, 2] = RuntimeHelpers.GetObjectValue(list.Rows[i]["Ngay"]);
                vSlist[i + 1, 3] = RuntimeHelpers.GetObjectValue(list.Rows[i]["MaTaiSan"]);
                vSlist[i + 1, 4] = RuntimeHelpers.GetObjectValue(list.Rows[i]["TenTaiSan"]);
                vSlist[i + 1, 5] = RuntimeHelpers.GetObjectValue(list.Rows[i]["NguyenGiaNT"]);
                vSlist[i + 1, 6] = RuntimeHelpers.GetObjectValue(list.Rows[i]["NguyenGia"]);
                vSlist[i + 1, 7] = RuntimeHelpers.GetObjectValue(list.Rows[i]["DienGiai"]);
            }
            vSlist = null;
        }

        private void VSlist_DoubleClick(object sender, EventArgs e)
        {
            if ((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0))
            {
                MyProject.Forms.Frm_GhiGiamTaiSan.Dispose();
                MyProject.Forms.Frm_GhiGiamTaiSan.cFrmKhoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Row, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                MyProject.Forms.Frm_GhiGiamTaiSan.Show();
            }
        }

        internal virtual CheckBox CKTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKTuNgay_CheckedChanged);
                if (this._CKTuNgay != null)
                {
                    this._CKTuNgay.CheckedChanged -= handler;
                }
                this._CKTuNgay = value;
                if (this._CKTuNgay != null)
                {
                    this._CKTuNgay.CheckedChanged += handler;
                }
            }
        }

        internal virtual Button CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual Button CmdLoad
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdLoad;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdLoad_Click);
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click -= handler;
                }
                this._CmdLoad = value;
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click += handler;
                }
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTuNgay = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.VSlist_DoubleClick);
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick -= handler;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.DoubleClick += handler;
                }
            }
        }
    }
}

